#ifndef USB485_H
#define USB485_H

#include "usb485_global.h"
#include "QDebug"
#include <QSerialPort>
#include <QTimer>
#include <QThread>

class USB485_EXPORT Usb485 :public QThread
{
    Q_OBJECT
public:
    void run();
//    void setPortName(QString serialportName);
    void stop();
    void init(QString serialportName);
    unsigned char adcFrameData[512];
    QString portName;
    QVector<double> plotx, ploty;
    int plotChannel;
    int plotTimeline;


private:
    QSerialPort *serial;
    int runFlag;
    int counter;
    int initFlag;
    unsigned char serialRxBuf[256];
    unsigned char serialTxBuf[256];
    int tempIndex;

};

#endif // USB485_H
